package com.github_dididipapa.mall.product.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @description: To be defined
 * @author: dididi_papa
 * @email: mitis1624087624@gmail.com
 * @date: 2025/07/07  11:21
 */
@Configuration
public class WebMvcConfig implements WebMvcConfigurer {

    /**
     * 添加处理器
     * 未加该处理器时使用此链接请求资源localhost:10000/index/js/swiper-3.4.2.jquery.min.js
     * 添加处理器后使用此链接请求资源localhost:10000/static/index/js/swiper-3.4.2.jquery.min.js
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
    }
}
